<template>
<h1>{{ props.msg }}</h1>
<h1>{{ message }}</h1>
<button @click="edit">子组件的改变按钮</button>
</template>

<script lang='ts'>
export default {
  name: 'scu6',
}
</script>

<script lang='ts' setup>
import { ref } from 'vue'
const props=defineProps({
    msg:{
        type:String,
        default:'我是默认值',
        required:true
    },
})
console.log(props);
const message=ref(props.msg)
const edit=()=>{
    message.value='我是子组件改变后的:举杯邀明月,对影成三人'
}
</script>

<style scoped lang='scss'>

</style>